﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.SqlServer.Dts.Runtime;

namespace PackageConfigs
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string ssisPackage = @"C:\Users\desarkar\Documents\Visual Studio 2008\Projects\John\John\Package1.dtsx";
            Package package = new Package();
            Microsoft.SqlServer.Dts.Runtime.Application application = new Microsoft.SqlServer.Dts.Runtime.Application();
            //PackageEvents packageEvents = new PackageEvents();
            DTSExecResult result;
            try
            {
                package = application.LoadPackage(ssisPackage, null);
                result = package.Execute();
                if (result == DTSExecResult.Success)
                {
                    MessageBox.Show("Success");
                }
                else
                {
                    MessageBox.Show("Failure");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }
    }
}
